class Person {
  constructor(name, age) {
    this.name = name
    this.age = age
  }
  running() {
    console.log(this.name + 'running');
  }
  personMethod() {
    console.log('处理逻辑1');
    console.log('处理逻辑2');
    console.log('处理逻辑3');
  }

  static PersonStaticMethod() {
    console.log('PersonStaticMethod');
  }
}

// Student称之为子类(派生类)
class Student extends Person {
  // js引擎在解析子类的时候就有要求:如果我们有实现集成
  // 那么子类的构造方法中,在使用this之前
  constructor(name, age, sno) {
    super(name, age)
    this.sno = sno
  }
  // 子类对父类方法的重写running
  running() {
    console.log(this.name + 'running!!!!!!!!!!!!!!!!!!!!!!!');
  }
  // 重写父类personMethod方法
  personMethod() {
    // 复用父类中的处理逻辑
    super.personMethod()
    console.log('处理逻辑4');
    console.log('处理逻辑6');
    console.log('处理逻辑5');
  }
}

var stu = new Student('why', 18, '01')

console.log(stu);

console.log(stu.__proto__.__proto__ === Person.prototype); // true

stu.running()
stu.personMethod()

Student.PersonStaticMethod()